#ifndef _CONSTANTS_H
#define _CONSTANTS_H

#if DEBUG
#define DBG(msg, args...) printf("DEBUG: "msg"\n", ##args)
#else
#define DBG(msg, args...)
#endif

#define FATAL(expr) {                                              \
        fprintf(stderr, "%s line %d in \"%s\": fatal error %s \n", \
                    __FILE__, __LINE__, __func__,  expr); exit(1); }



#define MAX_FILENAME            256
#define MAX_APPS                256
#define TLB_SIZE                128
#define MAX_BUF                 128
// HPCA results uses a limitation of 25
#define MAXREGION              40
// MAX DATA on Memory
//#define MAX_TRACE_BUFFERING     (1024*256)
#define MAX_TRACE_BUFFERING     (1024*1024)

#define POLICY_NOLM            0
#define POLICY_FIRST           1
#define POLICY_PROFILE         2
#define POLICY_FAIR            3
#define POLICY_FIRST_THRESHOLD 4
#define POLICY_PIVOT           5
#define POLICY_ALLLM           6
#define POLICY_PROFILE_DYNAMIC 7
#define POLICY_WORKINGSET      8
#define POLICY_FELI            9
#define POLICY_L1CACHE        10
#define POLICY_L2CACHE        11
#define POLICY_CLASSICCMP     12
#define POLICY_MULTIFELI      13


#define MEMORY_LOCATIONS        4
#define MAINMEMORY_INDEX        0
#define LOCALMEMORY_INDEX       1
#define RLOCALMEMORY_INDEX      2
#define L0MEMORY_INDEX          3


#define MAINMEMORY         2048
#define L2CACHE            2049
#define UNKNOWN            2050
#define UNDEFINED_LOCATION 2050
#define L0CACHE            2051
#define ALLMEMORY          0
#define MAXTHREADS         1024



#define MIGRATE_TH              0
#define MIGRATE_MUTEX           1
#define MIGRATE_MIX             2

#define LOAD_INST               1
#define STORE_INST              2

#define  L1_HIT                 0
#define  L2_HIT                 1
#define  L2REMOTE_HIT           2
#define  MAINMEMORY_HIT         3

#define  L1_TLBHIT              0
#define  L2_TLBHIT              1
#define  TLBREMOTEHIT           2

// Argv parsing constants
#define TELLME_CACHE            0
#define TELLME_LM               1
#define TELLME_TLB              2
#define TELLME_L0               3
#define TELLME_SIMULATION       4

#define L0_PARTIAL_INVALIDATE   0
#define L0_ALL_INVALIDATE       1
#define L0_FILTER_INVALIDATE    2

#define MULTIFELI_NORMAL 0
#define MULTIFELI_FROZE  1
#define MULTIFELI_PIVOT  2

#define   VICTIM_FIFO    0
#define   VICTIM_LRU     1
#define   VICTIM_NRU     2
#define   VICTIM_RANDOM  3


#endif
